﻿namespace BaseRepository.Redis;

public interface IRedisRepository
{
    //判断是否存在
    Task<bool> Exist(string key);

    //移除某一个缓存值
    Task Remove(string key);

    // string 类型的操作
    Task<TEntity?> StringGet<TEntity>(string key);
    Task<List<TEntity?>> StringGet<TEntity>(string[] keys);

    Task<bool> StringSet(string key, object? value, TimeSpan? cacheTime = null);
    Task<bool> StringSet(Dictionary<string,object> keyValues, TimeSpan? cacheTime = null);
    //KeyValuePair<RedisKey, RedisValue>[]
    //hash类型的操作
}